home *** CD-ROM | disk | FTP | other *** search
/ ShareWare OnLine 2 / ShareWare OnLine Volume 2 (CMS Software)(1993).iso / util2 / zipall11.zip / ZIPALL.BAT < prev    next >
DOS Batch File  |  1993-05-05  |  2KB  |  51 lines

  1. @echo off
  2. REM
  3. REM ZIPALL.BAT
  4. REM
  5. REM This BAT file can be executed from within any subdirectory to cause PKZIP
  6. REM to implode every file in the current directory and every file in its child
  7. REM directories (if any) into a single file called ALLFILES.ZIP.  All the ori-
  8. REM ginal files are moved (-m) into the ZIP file, the child subdirectories,  
  9. REM if any, will be removed and the current subdirectory will be 
  10. REM empty except for ALLFILES.ZIP.  Hidden and System files are zipped also 
  11. REM and the file attributes for Hidden, System and Readonly files are retained. 
  12. REM Use the UNZIPALL.BAT file when necessary.  Use ZIPALLT.BAT to accomplish the
  13. REM same feat while retaining the original files (copy instead of move).
  14. REM ALLFILES.ZIP should be unzipped with the "-d -Jhrs" switches if 
  15. REM PKUNZIP.EXE is used instead of UNZIPALL.BAT.
  16. REM
  17. if not exist allfiles.zip goto continue
  18. cls
  19. dir /w
  20. echo.
  21. echo This directory contains an ALLFILES.ZIP already.  Run RESTZIP.BAT to restore
  22. echo ALLFILES.ZIP as the only file in the directory (if you have no need to
  23. echo save any changes made to the other files) - OR - delete ALLFILES.ZIP and
  24. echo run ZIPALL again (to recompress the other files, saving changes.)  RESTZIP
  25. echo is much faster than ZIPALL -- especially for large subdirectories.
  26. goto exit
  27. :continue
  28. if not exist zipall1.usd goto contin2
  29. echo.
  30. echo This directory contains ZIPALL1.USD -- indicating ZIPALL1.BAT had been used
  31. echo previously to zip only the contents of current subdirectory and not any
  32. echo children subdirectories.  If you really want to do ZIPALL, delete the
  33. echo ZIPALL1.USD file first and then execute ZIPALL.
  34. goto exit
  35. :contin2
  36. pkzip allfiles *.* -ex -rp -whs -Jhrs -m 
  37. if errorlevel 1 goto errexit
  38. pdel allfiles.zip /o /eq /ba /wh /nt  
  39. dir /ad /b | feed eatdir.bat
  40. dir
  41. echo.
  42. echo ALLFILES.ZIP has been successfully created, moving the original files.
  43. echo Child subdirectories, if any, have been removed. 
  44. echo Use UNZIPALL.BAT to unzip, or PKUNZIP.EXE with the "-d -Jhrs" switches.            
  45. goto exit
  46. :errexit
  47. echo Error in execution of PKZIP (via ZIPALL.BAT).
  48. :exit
  49. prompt $p$g
  50. echo on
  51.